
*	************************************************************************
* 	File-Name: 		ENGO_2014_InformationElectricity_replication.do
*	Date:  			20 August 2014
*	Authors: 		Michael Aklin, Patrick Bayer, S.P. Harish, and Johannes Urpelainen
*	Journal:		Economics of Governance
* 	Paper:			Information and Energy Policy Preferences: A Survey Experiment on Public Opinion 
*					about Electricity Pricing Reform in Rural India
*
*	Data Used:  	InfoElec.dta	
*	Purpose:   		.do file for replication
*	Software:		Stata IC 12.1
*	Machine:		WINDOWS 7
*
*	************************************************************************

clear all

* NB: Please place .do file and data in the same folder
use "./InfoElec.dta"
set more off, permanently


*	************************************************************************
*	(I) MAIN TEXT
*	************************************************************************

keep treatment nonfree_elec invest_elec elec_privatize elec_state ///
interviewer_name village electricity market_forces school_years hhincome_monthly

* Preliminaries
tab treatment, gen(t_dummy)
label variable t_dummy1 "Control group"
label variable t_dummy2 "Treatment 2 (fundamental rights)"
label variable t_dummy3 "Treatment 1 (pricing reform)"

rename t_dummy1 t_control
rename t_dummy2 t_rights
rename t_dummy3 t_pricereform


*	************************************************************************
*	1. Summary statistics (Table 3)
*	************************************************************************

eststo clear
estpost summarize nonfree_elec invest_elec elec_privatize elec_state t_control t_pricereform t_rights

*	************************************************************************
*	2. Correlation matrix (Table 4)
*	************************************************************************

eststo clear
estpost correlate nonfree_elec invest_elec elec_privatize elec_state t_control t_pricereform t_rights, matrix


*	************************************************************************
*	3. Outcome measure 1 (Table 6)
*	************************************************************************

* T-tests
ttest nonfree_elec if t_pricereform==0, by(treatment)
ttest nonfree_elec if t_rights==0, by(treatment)
ttest nonfree_elec if t_control==0, by(treatment)

* UP government should not provide electricity for free
eststo clear
eststo: reg nonfree_elec t_pricereform t_rights, vce(robust)
eststo: xi: reg nonfree_elec t_pricereform t_rights i.interviewer_name i.village, vce(robust)
eststo: oprobit nonfree_elec t_pricereform t_rights, vce(robust)
eststo: xi: oprobit nonfree_elec t_pricereform t_rights i.interviewer_name i.village, vce(robust)

*	************************************************************************
*	4. Outcome measure 2 (Table 7)
*	************************************************************************

* T-tests
ttest invest_elec if t_pricereform==0, by(treatment)
ttest invest_elec if t_rights==0, by(treatment)
ttest invest_elec if t_control==0, by(treatment)

* UP government should invest in electricity generation despite price increases
eststo clear
eststo: reg invest_elec t_pricereform t_rights, vce(robust)
eststo: xi: reg invest_elec t_pricereform t_rights i.interviewer_name i.village, vce(robust)
eststo: oprobit invest_elec t_pricereform t_rights, vce(robust)
eststo: xi: oprobit invest_elec t_pricereform t_rights i.interviewer_name i.village, vce(robust)



*	************************************************************************
*	5. Outcome measure 3 (Table 8)
*	************************************************************************

* T-tests
ttest elec_privatize if t_pricereform==0, by(treatment)
ttest elec_privatize if t_rights==0, by(treatment)
ttest elec_privatize if t_control==0, by(treatment)

* Electricity markets should be privatized
eststo clear
eststo: reg elec_privatize t_pricereform t_rights, vce(robust)
eststo: xi: reg elec_privatize t_pricereform t_rights i.interviewer_name i.village, vce(robust)
eststo: oprobit elec_privatize t_pricereform t_rights, vce(robust)
eststo: xi: oprobit elec_privatize t_pricereform t_rights i.interviewer_name i.village, vce(robust)



*	************************************************************************
*	6. Outcome measure 4 (Table 9)
*	************************************************************************

* T-tests
ttest elec_state if t_pricereform==0, by(treatment)
ttest elec_state if t_rights==0, by(treatment)
ttest elec_state if t_control==0, by(treatment)

* Electricity is a commodity that should be provided by the state
eststo clear
eststo: reg elec_state t_pricereform t_rights, vce(robust)
eststo: xi: reg elec_state t_pricereform t_rights i.interviewer_name i.village, vce(robust)
eststo: oprobit elec_state t_pricereform t_rights, vce(robust)
eststo: xi: oprobit elec_state t_pricereform t_rights i.interviewer_name i.village, vce(robust)



*	************************************************************************
*	7. External validity test with Santhakumar data (Table 10)
*	************************************************************************

* Clear memory and load new dataset
clear all
set more off, permanently
use "./Santhakumar.dta"

* Drop Orissa as there was no question about privatization
drop if state == 4

* H1/H2 privatization test: little support for privatization overall
sum privatize_yes
sum privatize_no


* H3: 40% want higher tariffs and better supply, which does not depend on access to subsidy
* HUGE BONUS: Of people who pay more than they used to, 2/3 say this is acceptable! 
* Conversely, of those who do NOT pay more, only 1/2 say this is acceptable!
sum bettersupply_higher
ttest bettersupply_higher, by(tariff_change)

* H4: Education influences WTP for better supply, which in turn reduces perception of SEB efficiency
* Other than that, education has no effect on perception of SEB efficiency
* External validity regression with Santhakumar data
eststo clear
eststo: reg bettersupply_higher edu_years, robust
eststo: xi: reg bettersupply_higher edu_years i.district, robust
eststo: xi: reg bettersupply_higher edu_years age male agri subsidy hhassets i.district, robust

eststo: logit bettersupply_higher edu_years, robust
eststo: xi: logit bettersupply_higher edu_years i.district, robust
eststo: xi: logit bettersupply_higher edu_years age male agri subsidy hhassets i.district, robust


*	************************************************************************
*	(II) APPENDIX
*	************************************************************************

* Reload original survey data
clear all
use "./InfoElec.dta"
set more off, permanently

* Preliminaries
* NB: Recoding these variables is only needed if you re-load the "InfoElec.dta" data
tab treatment, gen(t_dummy)
label variable t_dummy1 "Control group"
label variable t_dummy2 "Treatment 2 (fundamental rights)"
label variable t_dummy3 "Treatment 1 (pricing reform)"

rename t_dummy1 t_control
rename t_dummy2 t_rights
rename t_dummy3 t_pricereform


*	************************************************************************
*	A1 -- Summary statistics and correlation matrix (Tables A1+A2)
*	************************************************************************

* Summary stats
eststo clear
estpost summarize nonfree_elec invest_elec elec_privatize elec_state t_control t_pricereform t_rights electricity market_forces school_years hhincome_monthly

* Correlation matrix
eststo clear
estpost correlate nonfree_elec invest_elec elec_privatize elec_state t_control t_pricereform t_rights electricity market_forces school_years hhincome_monthly, matrix


*	************************************************************************
*	A2 -- Regression models with pre-treatment controls (Tables A3-A6)
*	************************************************************************

* Outcome measure 1: UP government should not provide electricity for free
eststo clear
eststo: reg nonfree_elec t_pricereform t_rights if electricity!=., vce(robust)
eststo: xi: reg nonfree_elec t_pricereform t_rights i.interviewer_name i.village if electricity!=., vce(robust)
eststo: xi: reg nonfree_elec t_pricereform t_rights electricity market_forces i.interviewer_name i.village, vce(robust)
eststo: xi: reg nonfree_elec t_pricereform t_rights electricity market_forces school_years hhincome_monthly i.interviewer_name i.village, vce(robust)

eststo: oprobit nonfree_elec t_pricereform t_rights if electricity!=., vce(robust)
eststo: xi: oprobit nonfree_elec t_pricereform t_rights i.interviewer_name i.village if electricity!=., vce(robust)
eststo: xi: oprobit nonfree_elec t_pricereform t_rights electricity market_forces i.interviewer_name i.village, vce(robust)
eststo: xi: oprobit nonfree_elec t_pricereform t_rights electricity market_forces school_years hhincome_monthly i.interviewer_name i.village, vce(robust)

* Outcome measure 2: UP government should invest in electricity generation despite price increases
eststo clear
eststo: reg invest_elec t_pricereform t_rights if electricity!=., vce(robust)
eststo: xi: reg invest_elec t_pricereform t_rights i.interviewer_name i.village if electricity!=., vce(robust)
eststo: xi: reg invest_elec t_pricereform t_rights electricity market_forces i.interviewer_name i.village, vce(robust)
eststo: xi: reg invest_elec t_pricereform t_rights electricity market_forces school_years hhincome_monthly i.interviewer_name i.village, vce(robust)

eststo: oprobit invest_elec t_pricereform t_rights if electricity!=., vce(robust)
eststo: xi: oprobit invest_elec t_pricereform t_rights i.interviewer_name i.village if electricity!=., vce(robust)
eststo: xi: oprobit invest_elec t_pricereform t_rights electricity market_forces i.interviewer_name i.village, vce(robust)
eststo: xi: oprobit invest_elec t_pricereform t_rights electricity market_forces school_years hhincome_monthly i.interviewer_name i.village, vce(robust)

* Outcome measure 3: Electricity markets should be privatized
eststo clear
eststo: reg elec_privatize t_pricereform t_rights if electricity !=., vce(robust)
eststo: xi: reg elec_privatize t_pricereform t_rights i.interviewer_name i.village if electricity!=., vce(robust)
eststo: xi: reg elec_privatize t_pricereform t_rights electricity market_forces i.interviewer_name i.village, vce(robust)
eststo: xi: reg elec_privatize t_pricereform t_rights electricity market_forces school_years hhincome_monthly i.interviewer_name i.village, vce(robust)

eststo: oprobit elec_privatize t_pricereform t_rights if electricity !=., vce(robust)
eststo: xi: oprobit elec_privatize t_pricereform t_rights i.interviewer_name i.village if electricity!=., vce(robust)
eststo: xi: oprobit elec_privatize t_pricereform t_rights electricity market_forces i.interviewer_name i.village, vce(robust)
eststo: xi: oprobit elec_privatize t_pricereform t_rights electricity market_forces school_years hhincome_monthly i.interviewer_name i.village, vce(robust)

* Outcome measure 4: Electricity is a commodity that should be provided by the state
eststo clear
eststo: reg elec_state t_pricereform t_rights if electricity!=., vce(robust)
eststo: xi: reg elec_state t_pricereform t_rights i.interviewer_name i.village if electricity!=., vce(robust)
eststo: xi: reg elec_state t_pricereform t_rights electricity market_forces i.interviewer_name i.village, vce(robust)
eststo: xi: reg elec_state t_pricereform t_rights electricity market_forces school_years hhincome_monthly i.interviewer_name i.village, vce(robust)

eststo: oprobit elec_state t_pricereform t_rights if electricity!=., vce(robust)
eststo: xi: oprobit elec_state t_pricereform t_rights i.interviewer_name i.village if electricity!=., vce(robust)
eststo: xi: oprobit elec_state t_pricereform t_rights electricity market_forces i.interviewer_name i.village, vce(robust)
eststo: xi: oprobit elec_state t_pricereform t_rights electricity market_forces school_years hhincome_monthly i.interviewer_name i.village, vce(robust)
